package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayToLisDemo {
    public static void main(String[] args) {
        String[] array ={"one","two","three","four","five"};
        System.out.println("array:"+ Arrays.toString(array));

       List<String>list =Arrays.asList(array);
        System.out.println("list:"+list);

        list.set(2,"six");
        System.out.println("list:"+list);
        System.out.println("array:"+Arrays.toString(array));

        //list.add("seven");

        List<String> list2 =new ArrayList<>(list);
        System.out.println("list2:"+list2);
        list2.add("seven");
        System.out.println("list2:"+list2);
    }
}
